from ytbase.helper import *
from ytbase.model.post import *
from ytcommunity.forum.setting import CATEGORY
import ytbase.view.comment

def add(request, id):
    def filler(comment):
        comment.category = CATEGORY
        post = get_by_str_id(YTPost, id)
        post.put() #update post time
        return comment
    
    return ytbase.view.comment.add(request, id=id, filler=filler)

def delete(request, id):
    return ytbase.view.comment.delete(request, id=id)
